#include "stdafx.h"
#include "LgSpriteGate.h"

LgSpriteGate::LgSpriteGate(const vector<RectInBalloonElemnet_t>& listRect):
	LgSpriteStatic(listRect),m_bPass(false)
{
	m_eClassName=eLgSpriteGate;
	vector<RectInBalloonElemnet_t>::iterator it=m_vecHitRect.begin();
	for (;it!=m_vecHitRect.end();it++){
		if (it->nProperty&HPElectrisity){
			m_itElectronicArea=it;
			break;
		}
	}
}

LgSpriteGate::~LgSpriteGate(void)
{
}

void LgSpriteGate::UpdatePassState(bool bPass)
{
	if (bPass){
		m_itElectronicArea->nProperty=0;
	}else{
		m_itElectronicArea->nProperty=HPElectrisity;
	}
	m_bPass=bPass;
}